% test TCP IP
clear; clc;

IP = '127.0.0.1';
PORT = 8712;
channelNumber = 9;
buffer = [];

TCPIP = tcpip(IP, PORT);
TCPIP.InputBufferSize = 25600000;
fopen(TCPIP);

raw = [];
pause(5)

if TCPIP.BytesAvailable > 0
    toc
    fprintf('BytesAvailable: %d\n', TCPIP.BytesAvailable);
    raw = fread(TCPIP, TCPIP.BytesAvailable, 'uint8');
end

[data, remain] = tcpDataConvertor(raw, channelNumber);
fclose(TCPIP);



